#!bin/sh
source /etc/profile
day=$(date +%Y-%m-%d)
echo $day
yt=`date -d "1 days ago "  "+%Y-%m-%d"`
cd /home/marvin/sqoop-1.4.6-cdh5.6.0


bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table res_vipcoupon_station --export-dir /user/hive/warehouse/res_vipcoupon_station/ --input-fields-terminated-by ',' -m 1  --input-null-string '\\N' --input-null-non-string '\\N'





bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table res_hoseEfficiency --export-dir /user/hive/warehouse/res_hoseefficiency --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'


bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table comparison_hiveb --export-dir /user/hive/warehouse/comparison_hiveb --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'






bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table basket_bj --export-dir /user/hive/warehouse/basket_bj/ --input-fields-terminated-by ',' -m 1

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table basket_cd --export-dir /user/hive/warehouse/basket_cd/ --input-fields-terminated-by ',' -m 1

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table basket_all --export-dir /user/hive/warehouse/basket_all/ --input-fields-terminated-by ',' -m 1

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table RFM --export-dir /user/hive/warehouse/rfm/ --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table RFM_cd --export-dir /user/hive/warehouse/rfm_cd/ --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'




bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table res_notoilSearch --export-dir /user/hive/warehouse/res_notoilsearch/ --input-fields-terminated-by ',' -m 1 

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table tag_result --export-dir /user/hive/warehouse/tag_result/ --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'


bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table res_wechatmall_topall --export-dir /user/hive/warehouse/res_wechatmall_topall/ --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table res_evaluation --export-dir /user/hive/warehouse/res_evaluation/ --input-fields-terminated-by ',' -m 1

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table tag_result_thirty --export-dir /user/hive/warehouse/tag_result_thirty/ --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table tag_result_sixty --export-dir /user/hive/warehouse/tag_result_sixty/ --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table tag_result_ninety --export-dir /user/hive/warehouse/tag_result_ninety/ --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table tag_result_thirty_cd --export-dir /user/hive/warehouse/tag_result_thirty_cd/ --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table tag_result_sixty_cd --export-dir /user/hive/warehouse/tag_result_sixty_cd/ --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table tag_result_ninety_cd --export-dir /user/hive/warehouse/tag_result_ninety_cd/ --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table tag_result_cd --export-dir /user/hive/warehouse/tag_result_cd/ --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'



bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table res_coupon --export-dir /user/hive/warehouse/res_coupon/ --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'


bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table res_coupon_send --export-dir /user/hive/warehouse/res_coupon_send/ --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'


bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table res_vipcoupon_source --export-dir /user/hive/warehouse/res_vipcoupon_source/ --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table res_vipcoupon_oilnotoil --export-dir /user/hive/warehouse/res_vipcoupon_oilnotoil/ --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table res_vipcoupon_nature --export-dir /user/hive/warehouse/res_vipcoupon_nature/ --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table res_vipcoupon_discsource --export-dir /user/hive/warehouse/res_vipcoupon_discsource/ --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'



bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table res_oilb_vip --export-dir /user/hive/warehouse/res_oilb_vip --input-fields-terminated-by ',' -m 1

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table tag_result_alltime --export-dir /user/hive/warehouse/tag_result_alltime/ --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table tag_result_alltimecd --export-dir /user/hive/warehouse/tag_result_alltimecd/ --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table res_notoilSearch_vip --export-dir /user/hive/warehouse/res_notoilsearch_vip/ --input-fields-terminated-by ',' -m 1 

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table res_openingdate --export-dir /user/hive/warehouse/res_openingdate/ --input-fields-terminated-by ',' -m 1 

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table vip_item --export-dir /user/hive/warehouse/vip_item/ --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table vip_interval_cd --export-dir /user/hive/warehouse/vip_interval_cd/ --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table vip_interval --export-dir /user/hive/warehouse/vip_interval/ --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'

bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table vip_coupon --export-dir /user/hive/warehouse/vip_coupon/ --input-fields-terminated-by ',' -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'


bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table res_vipEvaluation_all --export-dir /user/hive/warehouse/res_vipevaluation_all/ --input-fields-terminated-by ',' -m 1

mysql -uroot -proot -hhadoop3 -e 'use result;truncate table res_serve_time;'
bin/sqoop export --connect jdbc:mysql://192.168.0.34:3306/result --username root --password root --table res_serve_time --export-dir /user/hive/warehouse/res_serve_time/  -m 1 --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'
